<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>登录后台|{:config('web_site_title')}</title>
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css">
    <link rel="stylesheet" href="__PUBLIC__/dist/css/style.css">

</head>

<body>

<div class="login-main">
    <header class="layui-elip">{:config('web_site_title')}后台管理</header>
    <form action="" class="layui-form">
        <div class="layui-input-inline">
            <input type="text" name="username" lay-verify="required" placeholder="用户名" autocomplete="off"
                   class="layui-input">
        </div>
        <div class="layui-input-inline">
            <input type="password" name="password" lay-verify="required" placeholder="密码" autocomplete="off"
                   class="layui-input">
        </div>
        <div class="layui-input-inline login-btn">
            <button type="submit" class="layui-btn" lay-submit lay-filter="login">登录</button>
        </div>
        <hr/>
        <p>Copyright©2014-2017 by 北京睿亿网络科技有限公司</p>
    </form>
</div>
<script src="__PUBLIC__/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="__PUBLIC__/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['form', 'layer'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery;

        // 表单提交监听
        form.on('submit(login)', function (data) {
            // 提交请求
            $.post("{:url('')}", data.field, function (res) {
                // 提示信息
                layer.msg(res.msg, {
                    time: 1500
                }, function () {
                    if (res.code == 1) {
                        window.location.href = res.url;
                    }
                });

            });
            return false;
        });

    });
</script>
</body>

</html>
